<template>
	<view class="leave_box">
    <navTitle :titleRight="''" :title="'個人優勢'"></navTitle>
    <view class="msg-box">
      <view class="fff-box">
        <view class="p-box">
          <view class="p-title">個人優勢</view>
          <view class="p-area">
            <textarea v-model.trim="summary" placeholder="請输入個人優勢"></textarea>
          </view>
        </view>
      </view>
    </view>
    <view class="fixed-footer" @tap="handleNext()">
      <view>提交</view>
    </view>
	</view>
</template>

<script>
import navTitle from './../../boss/components/nav-title.vue';
import {userSaveModule} from '../../../utils/userApi'
export default {
	components: {navTitle},
	data() {
		return {
      summary:'',
		};
	},
	props: {
		couponList: {}
	},
	computed: {
  },
  onShow(){
  },
  onLoad(options) {
    if(options.content){
      this.summary=options.content
    }
  },
	methods: {
    handleNext(){
      if(!this.summary){
        uni.showToast({
          icon:'none',
          title: '請輸入個人優勢'
        })
        return false
      }
      this.submitForm()
    },
    async submitForm(){
      let res=await userSaveModule({summary:this.summary})
			if(res.code==1){
				uni.showToast({
          icon:'none',
          title: '提交成功'
        })
        uni.navigateBack()
			}else{
				uni.showToast({
          icon:'none',
          title: res.msg||'系統異常'
        })
			}
    }
	}
};
</script>
<style lang="scss" scoped>
.leave_box{
  width: 100%;
  height: 100vh;
  overflow-y: scroll;
  background: #F4F6FA;
}
.msg-box{
  width: 100%;
  overflow-y: scroll;
  margin: 0 auto;
}
.fixed-footer{
  width: 100%;
  height: 50px;
  margin: 20px 0;
  view{
    width: calc(100% - 40px);
    height: 44px;
    line-height: 44px;
    text-align: center;
    background: linear-gradient( 90deg, #016CF1 0%, #0697F6 100%);
    border-radius: 8px;
    font-weight: 500;
    font-size: 15px;
    color: #FFFFFF;
    margin: 4px auto 0;
  }
}
.fff-box{
  background: #fff;
  width: calc(100% - 20px);
  border-radius: 10px;
  padding: 0 10px 20px;
  margin: 10px auto;
}
.p-title{
  font-size: 14px;
  color: #333333;
  line-height: 20px;
  padding: 15px 0 10px 0;
}
.p-list{
  display: flex;
  justify-content: center;
  align-items: center;
  .p-c{
    width: 50px;
    text-align: center;
    line-height: 50px;
  }
  .p-item{
    width: 145px;
    height: 50px;
    text-align: center;
    line-height: 50px;
    font-weight: 600;
    font-size: 16px;
    color: #333333;
    background: #F4F6FA;
    margin-bottom: 10px;
    border-radius: 8px;
  }
}
.p-input{
  width: calc(100% - 20px);
  height: 50px;
  line-height: 50px;
  border-radius: 8px;
  border: 1px solid #C2C7CC;
  color: #808080;
  font-size: 16px;
  padding: 0 10px;
  input{
    width: 100%;
    height: 100%;
  }
}
.p-area{
  width: calc(100% - 20px);
  height: 200px;
  line-height: 40px;
  border-radius: 8px;
  border: 1px solid #C2C7CC;
  color: #808080;
  font-size: 16px;
  padding:10px;
  textarea{
    width: 100%;
    height: 100%;
  }
}
.item {
  line-height: 100rpx;
  text-align: center;
}
.margin-top-20{
  margin-top: 20px;
}
</style>
